package com.fc.utils;

import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;

public class MessageUtils {
	public static void addInfo(String summary, String detail) {
		addInfo(null, summary, detail);
	}
	
	public static void addError(String summary, String detail) {
		addError(null, summary, detail);
	}
	
	public static void addInfo(String clientId, String summary, String detail) {
		FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO, summary, detail);
		FacesContext.getCurrentInstance().addMessage(clientId, message);
	}
	
	public static void addError(String clientId, String summary, String detail) {
		FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR, summary, detail);
		FacesContext.getCurrentInstance().addMessage(clientId, message);
	}
}
